package cn.sylinx.hbatis.ext.starter.common;

import java.util.Map;
import java.util.Properties;

class CommonRelaxedPropertyResolverWrapper implements RelaxedPropertyResolverWrapper {

	private RelaxedPropertyResolver relaxedPropertyResolver;

	public CommonRelaxedPropertyResolverWrapper(EnvironmentWrapper env, String prefix) {
		relaxedPropertyResolver = new RelaxedPropertyResolver((Properties) env.getSource(), prefix);
	}

	@Override
	public String getProperty(String key) {
		return relaxedPropertyResolver.getProperty(key);
	}

	@Override
	public String getProperty(String key, String defaultValue) {
		return relaxedPropertyResolver.getProperty(key, defaultValue);
	}

	@Override
	public Map<String, Object> getSubProperties(String keyPrefix) {
		return relaxedPropertyResolver.getSubProperties(keyPrefix);
	}

}
